package com.czk.gulimall.auth;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;

/**
 * springsession核心原理
 * 1 导入 RedisHttpSessionConfiguration
 * ① 给容器添加组件 RedisOperationsSessionRepository redis操作session session的增伤改查核心类
 * ② RedisOperationsSessionRepository父类导入SessionRepositoryFilter过滤器，每个请求过来都会经过filter,创建时自动从容器中获得redisRepository
 * ③ doFilterInternal包装原始的request和response SessionRepositoryRequestWrapper SessionRepositoryResponseWrapper->装饰者模式
 * 自动续期、续期redis的过期时间
 *
 * @Author:ChenZhangKun
 * @Date: 2022/2/22 22:25
 */
@SpringBootApplication
@EnableDiscoveryClient
@EnableFeignClients
@EnableRedisHttpSession
public class GulimallAuthServerApplication {
    public static void main(String[] args) {
        SpringApplication.run(GulimallAuthServerApplication.class, args);
    }
}
